$(function () {
    function hashID() {
        if (location.hash) {
            getDetailData().done(renderDetail)
            // renderDetail()
        }else{
            location.href="index.html"
        }
    }
    hashID()
    function getDetailData(){
        let options={

        };
        return $.ajax(`http://localhost:8888/goods/item/${location.hash.slice(1)}`,options)
    }
    
    function renderDetail(data){
        $(".detail-container").html(`
        <img src="${data.info.img_big_logo}">                    
        <p>${data.info.title}</p>
        ${data.info.goods_introduce}
        `)
        
        $("title").html(`
        ${data.info.title}
        `)
    }
    
})